package com.jsdx.td.common;

import lombok.Data;

/**
 * @作者 TD
 * @日期 2025/3/9
 */
@Data
public class ApiResponse {
    private Integer code;
    private String message;
    private Object data;
    public ApiResponse(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }
    public static ApiResponse success(Object data){
        return new ApiResponse(200,"success",data);
    }

    public static ApiResponse error(Integer code, String message){
        return new ApiResponse(code,message,null);
    }
    public static ApiResponse error(String message){
        return new ApiResponse(500,message,null);
    }
}
